package com.itheima.text6;

import java.util.concurrent.CountDownLatch;

public class Chile3 extends Thread {
    private CountDownLatch countDownLatch;

    public Chile3(CountDownLatch countDownLatch) {
        this.countDownLatch = countDownLatch;
    }

    @Override
    public void run() {
        for (int i = 1; i <= 20; i++) {
            System.out.println(getName() + "在吃第" + i + "个饺子");

        }
        //运行结束提示
        //每一次countDown方法的时候，就让计数器-1
        countDownLatch.countDown();
    }
}

